#include <iostream>
#include <unistd.h>
#include <jsoncpp/json/json.h>

int main()
{
    Json::Value root;
    root["x"]=100;
    root["y"]=200;
    root["op"]='+';
    root["dest"]="this is a + oper";

    //Json::FastWriter w;
    Json::StyledWriter w;
    std::string str=w.write(root);

    std::cout<<str<<std::endl;

    sleep(3);

    Json::Value v;
    Json::Reader r;
    r.parse(str,v);

    int x=v["x"].asInt();
    int y=v["y"].asInt();
    char op=v["op"].asInt();
    std::string dest=v["dest"].asCString();

    std::cout<<x<<std::endl;
    std::cout<<y<<std::endl;
    std::cout<<op<<std::endl;
    std::cout<<dest<<std::endl;

    return 0;


}